select a.catid, CONCAT_ws('-->',(select CONCAT_WS('-->',(select CONCAT_WS('-->',(select CONCAT_WS('-->',(select e.catname from alibaba_cat e where e.isleaf = 0 and e.catid = d.parentid),d.catname) from alibaba_cat d where d.isleaf = 0 and d.catid=c.parentid), c.catname) from alibaba_cat c where c.isleaf = 0 and c.catid = b.parentid),b.catname) from alibaba_cat b where b.isleaf =0 and b.catid = a.parentid),a.catname) as nnn
from alibaba_cat a where a.isleaf = 1